package com.suixun.vo;

import java.util.LinkedList;
import java.util.List;

import com.suixun.entity.BatchInfo;
import com.suixun.util.DateUtil;

public class BatchVO {
	private String batchid;
	private String id;
	private String createtime;
	private String status;
	public String getBatchid() {
		return batchid;
	}
	public void setBatchid(String batchid) {
		this.batchid = batchid;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getCreatetime() {
		return createtime;
	}
	public void setCreatetime(String createtime) {
		this.createtime = createtime;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	
	public List<BatchVO> batchInfoToVO(List<BatchInfo> batchList) {
		List<BatchVO> batchVOs=new LinkedList<>();
		for(BatchInfo batchInfo : batchList) {
			BatchVO batchVO = new BatchVO();
			batchVO.setId(batchInfo.getId() == null ? null : String.valueOf(batchInfo.getId()));
			batchVO.setCreatetime(DateUtil.formatDateToString(batchInfo.getCreatetime(), null));
			batchVO.setBatchid(batchInfo.getBatchcode());
			batchVO.setStatus(batchInfo.getStatus() == null ? null : String.valueOf(batchInfo.getStatus()));
			batchVOs.add(batchVO);
		}
		return batchVOs;
	}
}
